//
//  SecondViewController.m
//  TelBook
//
//  Created by dllo on 16/6/18.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SecondViewController.h"
#import "ViewController.h"
@interface SecondViewController ()
@property(nonatomic,retain)UITextField *textField;
@property(nonatomic,retain)UITextField *textField1;
@property(nonatomic,retain)UITextField *textField2;
@property(nonatomic,retain)UIImageView *imageview;

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.navigationItem.title =self.textfidKey;
    [self textfield];
    [self uilabel];
    [self imageView];
    [self confightNavigation];
}
-(void)confightNavigation{
    
   self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"返回.png"] style:UIBarButtonItemStylePlain target:self action:@selector(leftAction:)];
}




-(void)uilabel{
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(50, 300, 100, 100)];
    label.text = @" 姓  名";
    label.textColor = [UIColor blueColor];
    label.font = [UIFont systemFontOfSize:30];
    [self.view addSubview:label];
    
    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(50, 350, 100, 100)];
    label1.text = @"Q Q 号";
    label1.textColor = [UIColor blueColor];
    label1.font = [UIFont systemFontOfSize:30];
    [self.view addSubview:label1];
    
    UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(50, 400, 100, 100)];
    label2.text = @"电话号";
    label2.textColor = [UIColor blueColor];
    label2.font = [UIFont systemFontOfSize:30];
    [self.view addSubview:label2];
}



-(void)textfield{
    self.textField  = [[UITextField alloc]initWithFrame:CGRectMake(150, 300, 200, 100)];
    self.textField .text = self.textfidKey;

    self.textField .font =[UIFont systemFontOfSize:30];
    [self.view addSubview:_textField ];
    self.textField1  = [[UITextField alloc]initWithFrame:CGRectMake(150, 350, 200, 100)];
   self.textField1.text = self.QQKey;
    self.textField1.font =[UIFont systemFontOfSize:30];
    [self.view addSubview:_textField1];
    self.textField2= [[UITextField alloc]initWithFrame:CGRectMake(150, 400, 200, 100)];
    self.textField2.text = self.telKey;
    self.textField2.font =[UIFont systemFontOfSize:30];
    [self.view addSubview:_textField2];
}

-(void)imageView{
    UIImage *image = [UIImage imageNamed:self.imagekey];
  self.imageview =[[UIImageView alloc]initWithImage:image];
    self.imageview.frame = CGRectMake(100, 100, 200, 200);
    
    

    [self.view addSubview:_imageview];
}
-(void)leftAction:(UIButton*)left{
//    ViewController *vc = [[ViewController alloc]init];
    
    [self.delegate withName:self.textField.text withQq: self.textField1.text withTel:self.textField2.text withImage:self.imageview withIndexPath:self.indexPath];
    

    [self.navigationController popViewControllerAnimated:YES];
}






@end
